import service from '@/utils/request'
import { to } from '@/utils/awaitTo'
export const loginAPI = (data) => {
  const promiseA = service({
    url: '/sys/login',
    method: 'POST',
    data
  })
  return to(promiseA)
}

/**
 * 用户 - 获取用户资料
 * @description: 获取用户资料
 * @param {*}
 * @return {*}
 */
export function getUserProfileAPI() {
  return service({
    url: '/sys/profile',
    method: 'post'
  })
}
/**
 * 用户 - 获取头像
 * @description: 获取用户头像
 * @param {*} id 用户id
 * @return {*}
 */
export function getUserPhotoAPI(id) {
  return service({
    url: `/sys/user/${id}`
  })
}
